package cn.thoughtworks.school.utils;

public class Encrypt {

  public static String hashcode(String str) {
    long h = 0, off = 0;
    int len = str.length();
    for (int i = 0; i < len; i++) {
      h = 31 * h + str.charAt((int) off++);
    }
    return h + "";
  }

}
